//
//  TitleButton.swift
//  SinaBlog
//
//  Created by ChenWei on 15/10/5.
//  Copyright © 2015年 cw. All rights reserved.
//

import UIKit

class TitleButton: UIButton {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        selected = false
        sizeToFit()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        titleLabel?.frame.origin.x = 0
        imageView?.frame.origin.x = CGRectGetMaxX((titleLabel?.frame)!)
    }
    
}
